package com.diandian.backend.client.mapper;

import com.diandian.backend.client.domain.ClientClientPermission;
import com.diandian.backend.client.dto.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClientPermissionMapper {

    // 查询记录数
    Integer getCount(@Param("data") ClientClientPermissionPageParamDTO requestDTO);

    // 查询分页中的数据集合
    List<ClientClientPermission> getPage(@Param("data") ClientClientPermissionPageParamDTO requestDTO, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);

    // 查询详情
    ClientClientPermission getDetail(@Param("data") ClientClientPermissionDetailParamDTO requestDTO);

    // 根据数据id更新记录
    void updateById(@Param("data") ClientClientPermissionUpdateByIdParamDTO param);

    // 根据数据id删除记录
    void deleteById(@Param("data") ClientClientPermissionDeleteByIdParamDTO param);

    void deleteByClientId(@Param("clientId") String clientId);

    // 新增
    void add(@Param("data") ClientClientPermissionAddParamDTO param);

    // 查询数据集合
    List<ClientClientPermission> getList(@Param("data") ClientClientPermissionListParamDTO requestDTO);

    List<String> getPermissions(@Param("clientId") String clientId);
}